package edu.citadel.domain;


import edu.citadel.db.WorkItemDao;
import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;

import java.util.Date;
import java.util.List;

/**
 * User: jordan
 * Date: 3/10/13
 * Time: 1:42 PM
 */

@Configurable(autowire = Autowire.BY_TYPE)
public class WorkItem {
    @Autowired
    private WorkItemDao workItemDao;

    private List<Payment> payments;
    private int jobId;
    private int workItemId;
    private String workDescription;
    private double companyCost;
    private double clientCharge;
    private int estimatedHours;
    private Date startDate;
    private Date endDate;
    private double outstandingBalance;


    public WorkItem(){}

    public WorkItem(int jobId){
        this.jobId = jobId;
    }

    public void save() {
        workItemDao.save(this);
    }

    public int getJobId() {
        return jobId;
    }

    public void setJobId(int jobId) {
        this.jobId = jobId;
    }

    public List<Payment> getPayments() {
        return payments;
    }

    public void setPayments(List<Payment> payments) {
        this.payments = payments;
    }

    public int getWorkItemId() {
        return workItemId;
    }

    public void setWorkItemId(int workItemId) {
        this.workItemId = workItemId;
    }

    public String getWorkDescription() {
        return workDescription;
    }

    public void setWorkDescription(String workDescription) {
        this.workDescription = workDescription;
    }

    public double getCompanyCost() {
        return companyCost;
    }

    public void setCompanyCost(double companyCost) {
        this.companyCost = companyCost;
    }

    public double getClientCharge() {
        return clientCharge;
    }

    public void setClientCharge(double clientCharge) {
        this.clientCharge = clientCharge;
    }

    public int getEstimatedHours() {
        return estimatedHours;
    }

    public void setEstimatedHours(int estimatedHours) {
        this.estimatedHours = estimatedHours;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public double getOutstandingBalance() {
        return outstandingBalance;
    }

    public void setOutstandingBalance(double outstandingBalance) {
        this.outstandingBalance = outstandingBalance;
    }

    public WorkItemDao getWorkItemDao() {
        return workItemDao;
    }

    public void setWorkItemDao(WorkItemDao workItemDao) {
        this.workItemDao = workItemDao;
    }
}
